﻿using GalaSoft.MvvmLight;
using System.Windows;

namespace TransControlSystem.Model
{
    public class PriorityConfig : ObservableObject
    {
        /// <summary>
        /// 主建
        /// </summary>
        private int _Id;
        /// <summary>
        /// 主建
        /// </summary>
        public int Id
        {
            get { return _Id; }
            set
            {
                _Id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        /// <summary>
        /// 标签描述
        /// </summary>
        private string _TagDesc;
        /// <summary>
        /// 标签描述
        /// </summary>
        public string TagDesc
        {
            get { return _TagDesc; }
            set
            {
                _TagDesc = value;
                RaisePropertyChanged(() => TagDesc);
            }
        }
        /// <summary>
        /// 优先级
        /// </summary>
        private string _Priority;
        /// <summary>
        /// 优先级
        /// </summary>
        public string Priority
        {
            get { return _Priority; }
            set
            {
                _Priority = value;
                RaisePropertyChanged(() => Priority);
            }
        }
        /// <summary>
        /// 优先级序号
        /// </summary>
        private int _PriorityNo;
        /// <summary>
        /// 优先级序号
        /// </summary>
        public int PriorityNo
        {
            get { return _PriorityNo; }
            set
            {
                _PriorityNo = value;
                RaisePropertyChanged(() => PriorityNo);
            }
        }
        /// <summary>
        /// 优先级标签类别
        /// </summary>
        private string _TagType;
        /// <summary>
        /// 优先级标签类别
        /// </summary>
        public string TagType
        {
            get { return _TagType; }
            set
            {
                _TagType = value;
                RaisePropertyChanged(() => TagType);
            }
        }

        /// <summary>
        /// 是否显示提升优先级按钮
        /// </summary>
        private Visibility _PromotionPriorityIsDisplay;
        /// <summary>
        /// 是否显示提升优先级按钮
        /// </summary>
        public Visibility PromotionPriorityIsDisplay
        {
            get
            {
                if (_PriorityNo == 0)
                {
                    _PromotionPriorityIsDisplay = Visibility.Hidden;
                }
                else if (_PriorityNo == 1 && _Priority != "A")
                {
                    _PromotionPriorityIsDisplay = Visibility.Visible;
                }
                else
                {
                    _PromotionPriorityIsDisplay = Visibility.Hidden;
                }
                return _PromotionPriorityIsDisplay;
            }
            set
            {
                _PromotionPriorityIsDisplay = value;
                RaisePropertyChanged(() => PromotionPriorityIsDisplay);
            }
        }
        /// <summary>
        /// 是否显示降低优先级按钮 
        /// </summary>
        private Visibility _ReductionPriorityIsDisplay;
        /// <summary>
        /// 是否显示降低优先级按钮 
        /// </summary>
        public Visibility ReductionPriorityIsDisplay
        {
            get
            {
                if (_PriorityNo == 0)
                {
                    _ReductionPriorityIsDisplay = Visibility.Hidden;
                }
                else if (_PriorityNo == 1 && _Priority != "E")
                {
                    _ReductionPriorityIsDisplay = Visibility.Visible;
                }
                else
                {
                    _ReductionPriorityIsDisplay = Visibility.Hidden;
                }
                return _ReductionPriorityIsDisplay;
            }
            set
            {
                _ReductionPriorityIsDisplay = value;
                RaisePropertyChanged(() => ReductionPriorityIsDisplay);
            }
        }
    }
}
